/**
 * This class contains unit tests for validating the behavior of Apex classes
 * and triggers.
 *
 * Unit tests are class methods that verify whether a particular piece
 * of code is working properly. Unit test methods take no arguments,
 * commit no data to the database, and are flagged with the testMethod
 * keyword in the method definition.
 *
 * All test methods in an organization are executed whenever Apex code is deployed
 * to a production organization to confirm correctness, ensure code
 * coverage, and prevent regressions. All Apex classes are
 * required to have at least 75% code coverage in order to be deployed
 * to a production organization. In addition, all triggers must have some code coverage.
 * 
 * The @isTest class annotation indicates this class only contains test
 * methods. Classes defined with the @isTest annotation do not count against
 * the organization size limit for all Apex scripts.
 *
 * See the Apex Language Reference for more information about Testing and Code Coverage.
 */
@isTest
private class issueRecieptAndInvoiceClass_Test {

	static testMethod void myUnitTest() 
    {
    	/**************** FOR AMENDMENT METHODS In THIS CLASS TEST COVERAGE ********/
        // TO DO: implement unit test
        string result = null;
        PageReference pageRef = null;
        List<String> resultList = null;
        
        RecordType recordType = [select Id,IsActive,SObjectType,DeveloperName from RecordType where DeveloperName = 'New_Tenancy_Contract' AND SObjectType = 'Tenancy_Contract__c'];
        Map<string,RecordType> amendmentRecordTypeMap = new Map<string,RecordType>();
        for(RecordType tempObject : [SELECT Id,SObjectType,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' AND IsActive =: true])
        {
        	amendmentRecordTypeMap.put(tempObject.DeveloperName, tempObject);
        	
        }
        
        
        //For Tenancy Contract for Amendement Method...
        //Account Object Record...
        Account accountObject2 = new Account();
        accountObject2.Name = 'Test Account';
        accountObject2.License_Application_Step__c = 'Renewal Started';
        //accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        accountObject2.License_Application_Type__c = 'Renewal';
        accountObject2.Activity__c = 'Trading - One Activity';
        accountObject2.License_Issue_Date__c = system.today();
        accountObject2.License_Expiry_Date__c = System.Today().addYears(1);
        insert accountObject2;
        
        Location__c locationObject4 = new Location__c();
        locationObject4.Name = 'Test Land3 ';
        locationObject4.Location_Type__c = 'Land';
        locationObject4.Rental_Rate__c = 18000;
        insert locationObject4;
        Location__c locationObject5 = new Location__c();
        locationObject5.Name = 'Test Land33 ';
        locationObject5.Location_Type__c = 'Land';
        locationObject5.Rental_Rate__c = 18000;
        insert locationObject5;
        
        Location__c locationObject6 = new Location__c();
        locationObject6.Name = 'Test Land31 ';
        locationObject6.Location_Type__c = 'Land';
        locationObject6.Rental_Rate__c = 18000;
        insert locationObject6;
        
        Tenancy_Contract__c tenancyObject3 = new Tenancy_Contract__c();
        tenancyObject3.Location__c = locationObject4.id;
        tenancyObject3.RecordTypeId = recordType.id;
        tenancyObject3.Tenant__c = accountObject2.id;
        tenancyObject3.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject3.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject3;
        
        Tenancy_Contract__c tenancyObject4 = new Tenancy_Contract__c();
        tenancyObject4.Location__c = locationObject4.id;
        tenancyObject4.RecordTypeId = recordType.id;
        tenancyObject4.Tenant__c = accountObject2.id;
        tenancyObject4.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject4.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject4;
        
        Tenancy_Contract__c tenancyObject5 = new Tenancy_Contract__c();
        tenancyObject5.Location__c = locationObject4.id;
        tenancyObject5.RecordTypeId = recordType.id;
        tenancyObject5.Tenant__c = accountObject2.id;
        tenancyObject5.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject5.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject5;
        
        //For Update the Location with the current Locaiton...
        locationObject4.Current_Tenancy_Contract__c = tenancyObject3.Id;
        update locationObject4;
        
        locationObject5.Current_Tenancy_Contract__c = tenancyObject4.Id;
        update locationObject5;
        
        locationObject6.Current_Tenancy_Contract__c = tenancyObject5.Id;
        update locationObject6;
        
        
        
        //For Suspension Object Records...
        Fines__c fineObject1 = new Fines__c();
        fineObject1.Issue_Date__c = System.today();
        fineObject1.Account__c = accountObject2.id;
        fineObject1.Fine_Type__c = 'Fix Amount';
        fineObject1.Fine_Amount__c = 1000;
        fineObject1.Fines_Included__c = true;
        fineObject1.Status__c = 'Approved';
        insert fineObject1;
        
        
        //For Fees Object Records....
        List<Fee__c> feeObjectList = new List<Fee__c>();
        
        Fee__c feeObject3 = new Fee__c();
        feeObject3.Name = 'Amendment - Add Location';
        feeObject3.Fee_Type__c = 'Amendment - Add Location';
        feeObject3.Price__c = 56;
        //insert feeObject3;
        feeObjectList.add(feeObject3);
        
        Fee__c feeObject4 = new Fee__c();
        feeObject4.Name = 'Amendment – Change License Type Fee';
        feeObject4.Fee_Type__c = 'Amendment – Change License Type Fee';
        feeObject4.Price__c = 56;
        //insert feeObject4;
        feeObjectList.add(feeObject4);
                
        Fee__c feeObject5 = new Fee__c();
        feeObject5.Name = 'Activity1Activty2 Fee';
        feeObject5.Fee_Type__c = 'Activity1Activty2 Fee';
        feeObject5.Price__c = 56;
        //insert feeObject5;
        feeObjectList.add(feeObject5);
        
        Fee__c feeObject6 = new Fee__c();
        feeObject6.Name = 'Activity1Activty3 Fee';
        feeObject6.Fee_Type__c = 'Activity1Activty3 Fee';
        feeObject6.Price__c = 56;
        //insert feeObject6;
        feeObjectList.add(feeObject6);
        
        
        Fee__c feeObject7 = new Fee__c();
        feeObject7.Name = 'Activity1General Fee';
        feeObject7.Fee_Type__c = 'Activity1General Fee';
        feeObject7.Price__c = 56;
        //insert feeObject7;
        feeObjectList.add(feeObject7);
        
        Fee__c feeObject8 = new Fee__c();
        feeObject8.Name = 'Activity1Services Fee';
        feeObject8.Fee_Type__c = 'Activity1Services Fee';
        feeObject8.Price__c = 56;
        //insert feeObject8;
        feeObjectList.add(feeObject8);
        
        Fee__c feeObject9 = new Fee__c();
        feeObject9.Name = 'Activity1Industrial Fee';
        feeObject9.Fee_Type__c = 'Activity1Industrial Fee';
        feeObject9.Price__c = 56;
        //insert feeObject9;
        feeObjectList.add(feeObject9);
        
        Fee__c feeObject10 = new Fee__c();
        feeObject10.Name = 'Activity2Activity3 Fee';
        feeObject10.Fee_Type__c = 'Activity2Activity3 Fee';
        feeObject10.Price__c = 56;
        //insert feeObject10;
        feeObjectList.add(feeObject10);
        
        Fee__c feeObject11 = new Fee__c();
        feeObject11.Name = 'Activity2General Fee';
        feeObject11.Fee_Type__c = 'Activity2General Fee';
        feeObject11.Price__c = 56;
        //insert feeObject11;
        feeObjectList.add(feeObject11);
        
        Fee__c feeObject12 = new Fee__c();
        feeObject12.Name = 'Activity2Services Fee';
        feeObject12.Fee_Type__c = 'Activity2Services Fee';
        feeObject12.Price__c = 56;
        //insert feeObject12;
        feeObjectList.add(feeObject12);
        
        Fee__c feeObject13 = new Fee__c();
        feeObject13.Name = 'Activity2Industrial Fee';
        feeObject13.Fee_Type__c = 'Activity2Industrial Fee';
        feeObject13.Price__c = 56;
        //insert feeObject13;
        feeObjectList.add(feeObject13);
        
        Fee__c feeObject14 = new Fee__c();
        feeObject14.Name = 'Activity3General Fee';
        feeObject14.Fee_Type__c = 'Activity3General Fee';
        feeObject14.Price__c = 56;
        //insert feeObject14;
        feeObjectList.add(feeObject14);
        
        Fee__c feeObject15 = new Fee__c();
        feeObject15.Name = 'Activity3Services Fee';
        feeObject15.Fee_Type__c = 'Activity3Services Fee';
        feeObject15.Price__c = 56;
        //insert feeObject15;
        feeObjectList.add(feeObject15);
        
        Fee__c feeObject16 = new Fee__c();
        feeObject16.Name = 'Activity3Industrial Feee';
        feeObject16.Fee_Type__c = 'Activity3Industrial Fee';
        feeObject16.Price__c = 56;
        //insert feeObject16;
        feeObjectList.add(feeObject16);
        
        Fee__c feeObject17 = new Fee__c();
        feeObject17.Name = 'Amendment - Add Partner Fee';
        feeObject17.Fee_Type__c = 'Amendment - Add Partner Fee';
        feeObject17.Price__c = 56;
        //insert feeObject17;
        feeObjectList.add(feeObject17);
        
        Fee__c feeObject18 = new Fee__c();
        feeObject18.Name = 'Amendment - Change Share Percentage Fee';
        feeObject18.Fee_Type__c = 'Amendment - Change Share Percentage Fee';
        feeObject18.Price__c = 56;
        //insert feeObject18;
        feeObjectList.add(feeObject18);
        
        Fee__c feeObject19 = new Fee__c();
        feeObject19.Name = 'Amendment - Remove Partner Fee';
        feeObject19.Fee_Type__c = 'Amendment - Remove Partner Fee';
        feeObject19.Price__c = 56;
        //insert feeObject19;
        feeObjectList.add(feeObject19);
        
        Fee__c feeObject20 = new Fee__c();
        feeObject20.Name = 'Amendment – Replace Partner Fee';
        feeObject20.Fee_Type__c = 'Amendment – Replace Partner Fee';
        feeObject20.Price__c = 56;
        //insert feeObject20;
        feeObjectList.add(feeObject20);
        
        Fee__c feeObject21 = new Fee__c();
        feeObject21.Name = 'Amendment - New Article of Association Price';
        feeObject21.Fee_Type__c = 'Amendment - New Article of Association Price';
        feeObject21.Price__c = 56;
        //insert feeObject21;
        feeObjectList.add(feeObject21);
        
        Fee__c feeObject22 = new Fee__c();
        feeObject22.Name = 'Amendment – Change Company Manager';
        feeObject22.Fee_Type__c = 'Amendment – Change Company Manager';
        feeObject22.Price__c = 56;
        //insert feeObject22;
        feeObjectList.add(feeObject22);
        
        Fee__c feeObject23 = new Fee__c();
        feeObject23.Name = 'Amendment - Change Location';
        feeObject23.Fee_Type__c = 'Amendment - Change Location';
        feeObject23.Price__c = 56;
        //insert feeObject23;
        feeObjectList.add(feeObject23);
        
        Fee__c feeObject24 = new Fee__c();
        feeObject24.Name = 'Amendment - Change Company Name';
        feeObject24.Fee_Type__c = 'Amendment - Change Company Name';
        feeObject24.Price__c = 56;
        //insert feeObject24;
        feeObjectList.add(feeObject24);
        
        
        Fee__c feeObject25 = new Fee__c();
        feeObject25.Name = 'Advertisement Fee';
        feeObject25.Fee_Type__c = 'Advertisement Fee';
        feeObject25.Price__c = 56;
        //insert feeObject25;
        feeObjectList.add(feeObject25);
        
        Fee__c feeObject26 = new Fee__c();
        feeObject26.Name = 'Establishment Card Fee';
        feeObject26.Fee_Type__c = 'Establishment Card Fee';
        feeObject26.Price__c = 56;
        //insert feeObject26;
        feeObjectList.add(feeObject26);
        
        Fee__c feeObject27 = new Fee__c();
        feeObject27.Name = 'Employment ID Card Fee';
        feeObject27.Fee_Type__c = 'Employment ID Card Fee';
        feeObject27.Price__c = 56;
        //insert feeObject27;
        feeObjectList.add(feeObject27);
        
        Fee__c feeObject28 = new Fee__c();
        feeObject28.Name = 'Free Zone Entity Fee';
        feeObject28.Fee_Type__c = 'Free Zone Entity Fee';
        feeObject28.Price__c = 56;
        //insert feeObject28;
        feeObjectList.add(feeObject28);
        
        Fee__c feeObject29 = new Fee__c();
        feeObject29.Name = 'Amendment - Change Activity';
        feeObject29.Fee_Type__c = 'Amendment - Change Activity';
        feeObject29.Price__c = 56;
        //insert feeObject29;
        feeObjectList.add(feeObject29);
        
        Fee__c feeObject30 = new Fee__c();
        feeObject30.Name = 'Amendment - Remove Location';
        feeObject30.Fee_Type__c = 'Amendment - Remove Location';
        feeObject30.Price__c = 56;
        //insert feeObject30;
        feeObjectList.add(feeObject30);
        
        Fee__c feeObject31 = new Fee__c();
        feeObject31.Name = 'Amendment - New Key';
        feeObject31.Fee_Type__c = 'Amendment - New Key';
        feeObject31.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject31);
        
        Fee__c feeObject32 = new Fee__c();
        feeObject32.Name = 'Amendment - Change Company Manager';
        feeObject32.Fee_Type__c = 'Amendment - Change Company Manager';
        feeObject32.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject32);
        
        //Now Insert the Fee Object List...
        if(feeObjectList.size() > 0)
        	insert feeObjectList;
        
        
        //For Service Pricebook...
        List<Service_Price_Book__c> serviceBookList = new List<Service_Price_Book__c>();
        List<string> serviceBookTypeList = new List<string>();
        
        serviceBookTypeList.add('Renewal');
        serviceBookTypeList.add('New License');
        serviceBookTypeList.add('Cancellation');
        serviceBookTypeList.add('Amendment');
        serviceBookTypeList.add('Renewal Additional');
        
        for(String tempString : serviceBookTypeList)
        {
        	for(integer counter = 0; counter < feeObjectList.size(); counter++ )
        	{
        		Service_Price_Book__c servicePriceBook1 = new  Service_Price_Book__c();
	            servicePriceBook1.fee__c = feeObjectList[counter].id;
	            servicePriceBook1.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook1.License_App_Category__c  = 'Trading - One Activity';
	            servicePriceBook1.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook2 = new  Service_Price_Book__c();
	            servicePriceBook2.fee__c = feeObjectList[counter].id;
	            servicePriceBook2.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook2.License_App_Category__c  = 'Trading - Two Activity';
	            servicePriceBook2.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook3 = new  Service_Price_Book__c();
	            servicePriceBook3.fee__c = feeObjectList[counter].id;
	            servicePriceBook3.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook3.License_App_Category__c  = 'Trading - Three Activity';
	            servicePriceBook3.isActive__c = true;
	            
        		Service_Price_Book__c servicePriceBook4 = new  Service_Price_Book__c();
	            servicePriceBook4.fee__c = feeObjectList[counter].id;
	            servicePriceBook4.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook4.Location_Type__c = 'Land';
	            servicePriceBook4.License_App_Category__c  = 'Location'; 
	            servicePriceBook4.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook5 = new  Service_Price_Book__c();
	            servicePriceBook5.fee__c = feeObjectList[counter].id;
	            servicePriceBook5.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook5.Location_Type__c = 'Office';
	            servicePriceBook5.License_App_Category__c  = 'Location'; 
        		servicePriceBook5.isActive__c = true;
        		
        		Service_Price_Book__c servicePriceBook6 = new  Service_Price_Book__c();
	            servicePriceBook6.fee__c = feeObjectList[counter].id;
	            servicePriceBook6.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook6.Location_Type__c = 'Guarantee';
	            servicePriceBook6.License_App_Category__c  = 'Location';
	            servicePriceBook6.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook7 = new  Service_Price_Book__c();
	            servicePriceBook7.fee__c = feeObjectList[counter].id;
	            servicePriceBook7.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook7.License_App_Category__c  = 'Trading - General Trading';
	            servicePriceBook7.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook8 = new  Service_Price_Book__c();
	            servicePriceBook8.fee__c = feeObjectList[counter].id;
	            servicePriceBook8.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook8.License_App_Category__c  = 'Services';
	            servicePriceBook8.isActive__c = true;
        		
        		//Adding in the list...
        		serviceBookList.add(servicePriceBook1);
        		serviceBookList.add(servicePriceBook2);
        		serviceBookList.add(servicePriceBook3);
        		serviceBookList.add(servicePriceBook4);
        		serviceBookList.add(servicePriceBook5);
        		serviceBookList.add(servicePriceBook6);
        		serviceBookList.add(servicePriceBook7);
        		serviceBookList.add(servicePriceBook8);
        		
        		
        		
        	}
        
        
        }
        
        //For inserting the Service PRicebook...
        if(serviceBookList.size() > 0)
        	insert serviceBookList;
        
        
         //For Amendment Object For New Tenancy Contract Method...
        Amendment__c amendmentObject1 = new Amendment__c();
        amendmentObject1.RecordTypeId = amendmentRecordTypeMap.get('Company_Amendment_Change_Company_Name').Id;
        amendmentObject1.Account__c = accountObject2.Id;
        amendmentObject1.New_Location__c = locationObject4.Id;
        amendmentObject1.New_Location_2__c = locationObject5.Id;
        amendmentObject1.New_Location_3__c = locationObject6.Id;
        amendmentObject1.New_License_Type__c = 'Trading - Two Activity';
        //amendmentObject.Chamber_History__c = chamberObject.id;
        insert amendmentObject1;
        
        
        //Now Calling the Methods...
        string popDate1  = string.valueof(accountObject2.License_Expiry_Date__c); 
        popDate1 = string.valueOf(popDate1.split('-')[2]+'/'+popDate1.split('-')[1]+'/'+popDate1.split('-')[0]);
        
        System.debug('The Pop Date 1=> '+ popDate1);
        resultList = issueRecieptAndInvoiceClass.generateTenancyContractForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - Add Location',null,popDate1);
        resultList = issueRecieptAndInvoiceClass.generateTenancyContractForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - Change Location',null,popDate1);
        
        //For generatingAmendmentInvoiceAndLineItemForAmendmentMethod Methods...
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - Add Location',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Shareholder Amendment - Add Partner',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Shareholder Amendment - Change Share Percentage',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Shareholder Amendment - Remove Partner',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Shareholder Amendment - Replace Partner',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change Company Manager',null,'False',null);
        amendmentObject1.Previous_Tenancy_Contract__c = tenancyObject4.Id;
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - Change Location',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change Company Name','Free Zone Entity - F.Z.E','False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change Company Activity',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - Remove Location',null,'False',null);
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Location Amendment - New Key',null,'False',null);
        
        //Company Amendment - Change License Type Amendment Invoice and Line Items...
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        /*amendmentObject1.New_License_Type__c = 'Trading - Three Activity';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
       	
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Two Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - Three Activity';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Three Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	
    	//For Receipt Amendment Methods...
    	List<Id> invoiceIdsList = new List<Id>();
    	
    	 //For Invoice Object Records...
        Invoice__c invoiceObject = new Invoice__c();
        invoiceObject.Account__c = accountObject2.id;
        invoiceObject.Date__c = System.Today();
        invoiceObject.Fee_Application_Type__c = 'New License';
        invoiceObject.Invoice_Type__c = 'New License';
        
        insert invoiceObject;
        
        //Insert in the list...
        invoiceIdsList.add(invoiceObject.id);
        
        //For Invoice Line Item Object Records....
        List<Invoice_Line_Item__c> invoiceItemList = new List<Invoice_Line_Item__c>();  
        Invoice_Line_Item__c invoiceItemObject1 = new Invoice_Line_Item__c();
        invoiceItemObject1.Amount__c = 67;
        invoiceItemObject1.Invoice__c = invoiceObject.id;
        invoiceItemObject1.Start_Date__c = System.Today();
        invoiceItemObject1.End_Date__c = System.today().addYears(1);
        //insert invoiceItemObject1;
        invoiceItemList.add(invoiceItemObject1);
        
        Invoice_Line_Item__c invoiceItemObject2 = new Invoice_Line_Item__c();
        invoiceItemObject2.Amount__c = 67;
        invoiceItemObject2.Invoice__c = invoiceObject.id;
        invoiceItemObject2.Start_Date__c = System.Today().addYears(1);
        invoiceItemObject2.End_Date__c = System.today().addYears(2);
        invoiceItemObject2.Suspension__c = fineObject1.id;
        //insert invoiceItemObject2;
        invoiceItemList.add(invoiceItemObject2);
        
        //For INserting hte Records of Invoice Line Items...
        if(invoiceItemList.size() > 0)
        	insert invoiceItemList;
        
    	//Calling the Methods...
    	//result = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceObject.Id,amendmentObject1.Id);
    	resultList = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceIdsList,amendmentObject1.Id);*/
    	        
        
    }
    
    static testMethod void myUnitTest1() 
    {
    	/**************** FOR AMENDMENT METHODS In THIS CLASS TEST COVERAGE ********/
        // TO DO: implement unit test
        string result = null;
        PageReference pageRef = null;
        List<String> resultList = null;
        
        RecordType recordType = [select Id,IsActive,SObjectType,DeveloperName from RecordType where DeveloperName = 'New_Tenancy_Contract' AND SObjectType = 'Tenancy_Contract__c'];
        Map<string,RecordType> amendmentRecordTypeMap = new Map<string,RecordType>();
        for(RecordType tempObject : [SELECT Id,SObjectType,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' AND IsActive =: true])
        {
        	amendmentRecordTypeMap.put(tempObject.DeveloperName, tempObject);
        	
        }
        
        
        //For Tenancy Contract for Amendement Method...
        //Account Object Record...
        Account accountObject2 = new Account();
        accountObject2.Name = 'Test Account';
        accountObject2.License_Application_Step__c = 'Renewal Started';
        //accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        accountObject2.License_Application_Type__c = 'Renewal';
        accountObject2.Activity__c = 'Trading - One Activity';
        accountObject2.License_Issue_Date__c = system.today();
        accountObject2.License_Expiry_Date__c = System.Today().addYears(1);
        insert accountObject2;
        
        Location__c locationObject4 = new Location__c();
        locationObject4.Name = 'Test Land3 ';
        locationObject4.Location_Type__c = 'Land';
        locationObject4.Rental_Rate__c = 18000;
        insert locationObject4;
        Location__c locationObject5 = new Location__c();
        locationObject5.Name = 'Test Land33 ';
        locationObject5.Location_Type__c = 'Land';
        locationObject5.Rental_Rate__c = 18000;
        insert locationObject5;
        
        Location__c locationObject6 = new Location__c();
        locationObject6.Name = 'Test Land31 ';
        locationObject6.Location_Type__c = 'Land';
        locationObject6.Rental_Rate__c = 18000;
        insert locationObject6;
        
        Tenancy_Contract__c tenancyObject3 = new Tenancy_Contract__c();
        tenancyObject3.Location__c = locationObject4.id;
        tenancyObject3.RecordTypeId = recordType.id;
        tenancyObject3.Tenant__c = accountObject2.id;
        tenancyObject3.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject3.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject3;
        
        Tenancy_Contract__c tenancyObject4 = new Tenancy_Contract__c();
        tenancyObject4.Location__c = locationObject4.id;
        tenancyObject4.RecordTypeId = recordType.id;
        tenancyObject4.Tenant__c = accountObject2.id;
        tenancyObject4.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject4.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject4;
        
        Tenancy_Contract__c tenancyObject5 = new Tenancy_Contract__c();
        tenancyObject5.Location__c = locationObject4.id;
        tenancyObject5.RecordTypeId = recordType.id;
        tenancyObject5.Tenant__c = accountObject2.id;
        tenancyObject5.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject5.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject5;
        
        //For Update the Location with the current Locaiton...
        locationObject4.Current_Tenancy_Contract__c = tenancyObject3.Id;
        update locationObject4;
        
        locationObject5.Current_Tenancy_Contract__c = tenancyObject4.Id;
        update locationObject5;
        
        locationObject6.Current_Tenancy_Contract__c = tenancyObject5.Id;
        update locationObject6;
        
        
        
        //For Suspension Object Records...
        Fines__c fineObject1 = new Fines__c();
        fineObject1.Issue_Date__c = System.today();
        fineObject1.Account__c = accountObject2.id;
        fineObject1.Fine_Type__c = 'Fix Amount';
        fineObject1.Fine_Amount__c = 1000;
        fineObject1.Fines_Included__c = true;
        fineObject1.Status__c = 'Approved';
        insert fineObject1;
        
        
        //For Fees Object Records....
        List<Fee__c> feeObjectList = new List<Fee__c>();
        
        Fee__c feeObject3 = new Fee__c();
        feeObject3.Name = 'Amendment - Add Location';
        feeObject3.Fee_Type__c = 'Amendment - Add Location';
        feeObject3.Price__c = 56;
        //insert feeObject3;
        feeObjectList.add(feeObject3);
        
        Fee__c feeObject4 = new Fee__c();
        feeObject4.Name = 'Amendment – Change License Type Fee';
        feeObject4.Fee_Type__c = 'Amendment – Change License Type Fee';
        feeObject4.Price__c = 56;
        //insert feeObject4;
        feeObjectList.add(feeObject4);
                
        Fee__c feeObject5 = new Fee__c();
        feeObject5.Name = 'Activity1Activty2 Fee';
        feeObject5.Fee_Type__c = 'Activity1Activty2 Fee';
        feeObject5.Price__c = 56;
        //insert feeObject5;
        feeObjectList.add(feeObject5);
        
        Fee__c feeObject6 = new Fee__c();
        feeObject6.Name = 'Activity1Activty3 Fee';
        feeObject6.Fee_Type__c = 'Activity1Activty3 Fee';
        feeObject6.Price__c = 56;
        //insert feeObject6;
        feeObjectList.add(feeObject6);
        
        
        Fee__c feeObject7 = new Fee__c();
        feeObject7.Name = 'Activity1General Fee';
        feeObject7.Fee_Type__c = 'Activity1General Fee';
        feeObject7.Price__c = 56;
        //insert feeObject7;
        feeObjectList.add(feeObject7);
        
        Fee__c feeObject8 = new Fee__c();
        feeObject8.Name = 'Activity1Services Fee';
        feeObject8.Fee_Type__c = 'Activity1Services Fee';
        feeObject8.Price__c = 56;
        //insert feeObject8;
        feeObjectList.add(feeObject8);
        
        Fee__c feeObject9 = new Fee__c();
        feeObject9.Name = 'Activity1Industrial Fee';
        feeObject9.Fee_Type__c = 'Activity1Industrial Fee';
        feeObject9.Price__c = 56;
        //insert feeObject9;
        feeObjectList.add(feeObject9);
        
        Fee__c feeObject10 = new Fee__c();
        feeObject10.Name = 'Activity2Activity3 Fee';
        feeObject10.Fee_Type__c = 'Activity2Activity3 Fee';
        feeObject10.Price__c = 56;
        //insert feeObject10;
        feeObjectList.add(feeObject10);
        
        Fee__c feeObject11 = new Fee__c();
        feeObject11.Name = 'Activity2General Fee';
        feeObject11.Fee_Type__c = 'Activity2General Fee';
        feeObject11.Price__c = 56;
        //insert feeObject11;
        feeObjectList.add(feeObject11);
        
        Fee__c feeObject12 = new Fee__c();
        feeObject12.Name = 'Activity2Services Fee';
        feeObject12.Fee_Type__c = 'Activity2Services Fee';
        feeObject12.Price__c = 56;
        //insert feeObject12;
        feeObjectList.add(feeObject12);
        
        Fee__c feeObject13 = new Fee__c();
        feeObject13.Name = 'Activity2Industrial Fee';
        feeObject13.Fee_Type__c = 'Activity2Industrial Fee';
        feeObject13.Price__c = 56;
        //insert feeObject13;
        feeObjectList.add(feeObject13);
        
        Fee__c feeObject14 = new Fee__c();
        feeObject14.Name = 'Activity3General Fee';
        feeObject14.Fee_Type__c = 'Activity3General Fee';
        feeObject14.Price__c = 56;
        //insert feeObject14;
        feeObjectList.add(feeObject14);
        
        Fee__c feeObject15 = new Fee__c();
        feeObject15.Name = 'Activity3Services Fee';
        feeObject15.Fee_Type__c = 'Activity3Services Fee';
        feeObject15.Price__c = 56;
        //insert feeObject15;
        feeObjectList.add(feeObject15);
        
        Fee__c feeObject16 = new Fee__c();
        feeObject16.Name = 'Activity3Industrial Feee';
        feeObject16.Fee_Type__c = 'Activity3Industrial Fee';
        feeObject16.Price__c = 56;
        //insert feeObject16;
        feeObjectList.add(feeObject16);
        
        Fee__c feeObject17 = new Fee__c();
        feeObject17.Name = 'Amendment - Add Partner Fee';
        feeObject17.Fee_Type__c = 'Amendment - Add Partner Fee';
        feeObject17.Price__c = 56;
        //insert feeObject17;
        feeObjectList.add(feeObject17);
        
        Fee__c feeObject18 = new Fee__c();
        feeObject18.Name = 'Amendment - Change Share Percentage Fee';
        feeObject18.Fee_Type__c = 'Amendment - Change Share Percentage Fee';
        feeObject18.Price__c = 56;
        //insert feeObject18;
        feeObjectList.add(feeObject18);
        
        Fee__c feeObject19 = new Fee__c();
        feeObject19.Name = 'Amendment - Remove Partner Fee';
        feeObject19.Fee_Type__c = 'Amendment - Remove Partner Fee';
        feeObject19.Price__c = 56;
        //insert feeObject19;
        feeObjectList.add(feeObject19);
        
        Fee__c feeObject20 = new Fee__c();
        feeObject20.Name = 'Amendment – Replace Partner Fee';
        feeObject20.Fee_Type__c = 'Amendment – Replace Partner Fee';
        feeObject20.Price__c = 56;
        //insert feeObject20;
        feeObjectList.add(feeObject20);
        
        Fee__c feeObject21 = new Fee__c();
        feeObject21.Name = 'Amendment - New Article of Association Price';
        feeObject21.Fee_Type__c = 'Amendment - New Article of Association Price';
        feeObject21.Price__c = 56;
        //insert feeObject21;
        feeObjectList.add(feeObject21);
        
        Fee__c feeObject22 = new Fee__c();
        feeObject22.Name = 'Amendment – Change Company Manager';
        feeObject22.Fee_Type__c = 'Amendment – Change Company Manager';
        feeObject22.Price__c = 56;
        //insert feeObject22;
        feeObjectList.add(feeObject22);
        
        Fee__c feeObject23 = new Fee__c();
        feeObject23.Name = 'Amendment - Change Location';
        feeObject23.Fee_Type__c = 'Amendment - Change Location';
        feeObject23.Price__c = 56;
        //insert feeObject23;
        feeObjectList.add(feeObject23);
        
        Fee__c feeObject24 = new Fee__c();
        feeObject24.Name = 'Amendment - Change Company Name';
        feeObject24.Fee_Type__c = 'Amendment - Change Company Name';
        feeObject24.Price__c = 56;
        //insert feeObject24;
        feeObjectList.add(feeObject24);
        
        
        Fee__c feeObject25 = new Fee__c();
        feeObject25.Name = 'Advertisement Fee';
        feeObject25.Fee_Type__c = 'Advertisement Fee';
        feeObject25.Price__c = 56;
        //insert feeObject25;
        feeObjectList.add(feeObject25);
        
        Fee__c feeObject26 = new Fee__c();
        feeObject26.Name = 'Establishment Card Fee';
        feeObject26.Fee_Type__c = 'Establishment Card Fee';
        feeObject26.Price__c = 56;
        //insert feeObject26;
        feeObjectList.add(feeObject26);
        
        Fee__c feeObject27 = new Fee__c();
        feeObject27.Name = 'Employment ID Card Fee';
        feeObject27.Fee_Type__c = 'Employment ID Card Fee';
        feeObject27.Price__c = 56;
        //insert feeObject27;
        feeObjectList.add(feeObject27);
        
        Fee__c feeObject28 = new Fee__c();
        feeObject28.Name = 'Free Zone Entity Fee';
        feeObject28.Fee_Type__c = 'Free Zone Entity Fee';
        feeObject28.Price__c = 56;
        //insert feeObject28;
        feeObjectList.add(feeObject28);
        
        Fee__c feeObject29 = new Fee__c();
        feeObject29.Name = 'Amendment - Change Activity';
        feeObject29.Fee_Type__c = 'Amendment - Change Activity';
        feeObject29.Price__c = 56;
        //insert feeObject29;
        feeObjectList.add(feeObject29);
        
        Fee__c feeObject30 = new Fee__c();
        feeObject30.Name = 'Amendment - Remove Location';
        feeObject30.Fee_Type__c = 'Amendment - Remove Location';
        feeObject30.Price__c = 56;
        //insert feeObject30;
        feeObjectList.add(feeObject30);
        
        Fee__c feeObject31 = new Fee__c();
        feeObject31.Name = 'Amendment - New Key';
        feeObject31.Fee_Type__c = 'Amendment - New Key';
        feeObject31.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject31);
        
        Fee__c feeObject32 = new Fee__c();
        feeObject32.Name = 'Amendment - Change Company Manager';
        feeObject32.Fee_Type__c = 'Amendment - Change Company Manager';
        feeObject32.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject32);
        
        //Now Insert the Fee Object List...
        if(feeObjectList.size() > 0)
        	insert feeObjectList;
        
        
        //For Service Pricebook...
        List<Service_Price_Book__c> serviceBookList = new List<Service_Price_Book__c>();
        List<string> serviceBookTypeList = new List<string>();
        
        serviceBookTypeList.add('Renewal');
        serviceBookTypeList.add('New License');
        serviceBookTypeList.add('Cancellation');
        serviceBookTypeList.add('Amendment');
        serviceBookTypeList.add('Renewal Additional');
        
        for(String tempString : serviceBookTypeList)
        {
        	for(integer counter = 0; counter < feeObjectList.size(); counter++ )
        	{
        		Service_Price_Book__c servicePriceBook1 = new  Service_Price_Book__c();
	            servicePriceBook1.fee__c = feeObjectList[counter].id;
	            servicePriceBook1.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook1.License_App_Category__c  = 'Trading - One Activity';
	            servicePriceBook1.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook2 = new  Service_Price_Book__c();
	            servicePriceBook2.fee__c = feeObjectList[counter].id;
	            servicePriceBook2.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook2.License_App_Category__c  = 'Trading - Two Activity';
	            servicePriceBook2.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook3 = new  Service_Price_Book__c();
	            servicePriceBook3.fee__c = feeObjectList[counter].id;
	            servicePriceBook3.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook3.License_App_Category__c  = 'Trading - Three Activity';
	            servicePriceBook3.isActive__c = true;
	            
        		Service_Price_Book__c servicePriceBook4 = new  Service_Price_Book__c();
	            servicePriceBook4.fee__c = feeObjectList[counter].id;
	            servicePriceBook4.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook4.Location_Type__c = 'Land';
	            servicePriceBook4.License_App_Category__c  = 'Location'; 
	            servicePriceBook4.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook5 = new  Service_Price_Book__c();
	            servicePriceBook5.fee__c = feeObjectList[counter].id;
	            servicePriceBook5.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook5.Location_Type__c = 'Office';
	            servicePriceBook5.License_App_Category__c  = 'Location'; 
        		servicePriceBook5.isActive__c = true;
        		
        		Service_Price_Book__c servicePriceBook6 = new  Service_Price_Book__c();
	            servicePriceBook6.fee__c = feeObjectList[counter].id;
	            servicePriceBook6.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook6.Location_Type__c = 'Guarantee';
	            servicePriceBook6.License_App_Category__c  = 'Location';
	            servicePriceBook6.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook7 = new  Service_Price_Book__c();
	            servicePriceBook7.fee__c = feeObjectList[counter].id;
	            servicePriceBook7.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook7.License_App_Category__c  = 'Trading - General Trading';
	            servicePriceBook7.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook8 = new  Service_Price_Book__c();
	            servicePriceBook8.fee__c = feeObjectList[counter].id;
	            servicePriceBook8.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook8.License_App_Category__c  = 'Services';
	            servicePriceBook8.isActive__c = true;
        		
        		//Adding in the list...
        		serviceBookList.add(servicePriceBook1);
        		serviceBookList.add(servicePriceBook2);
        		serviceBookList.add(servicePriceBook3);
        		serviceBookList.add(servicePriceBook4);
        		serviceBookList.add(servicePriceBook5);
        		serviceBookList.add(servicePriceBook6);
        		serviceBookList.add(servicePriceBook7);
        		serviceBookList.add(servicePriceBook8);
        		
        		
        		
        	}
        
        
        }
        
        //For inserting the Service PRicebook...
        if(serviceBookList.size() > 0)
        	insert serviceBookList;
        
        
         //For Amendment Object For New Tenancy Contract Method...
        Amendment__c amendmentObject1 = new Amendment__c();
        amendmentObject1.RecordTypeId = amendmentRecordTypeMap.get('Company_Amendment_Change_Company_Name').Id;
        amendmentObject1.Account__c = accountObject2.Id;
        amendmentObject1.New_Location__c = locationObject4.Id;
        amendmentObject1.New_Location_2__c = locationObject5.Id;
        amendmentObject1.New_Location_3__c = locationObject6.Id;
        amendmentObject1.New_License_Type__c = 'Trading - Two Activity';
        //amendmentObject.Chamber_History__c = chamberObject.id;
        insert amendmentObject1;
        
        
        //Now Calling the Methods...
        string popDate1  = string.valueof(accountObject2.License_Expiry_Date__c); 
        popDate1 = string.valueOf(popDate1.split('-')[2]+'/'+popDate1.split('-')[1]+'/'+popDate1.split('-')[0]);
        
        /*amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Two Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - Three Activity';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);*/
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Three Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	
    	//For Receipt Amendment Methods...
    	List<Id> invoiceIdsList = new List<Id>();
    	
    	 //For Invoice Object Records...
        Invoice__c invoiceObject = new Invoice__c();
        invoiceObject.Account__c = accountObject2.id;
        invoiceObject.Date__c = System.Today();
        invoiceObject.Fee_Application_Type__c = 'New License';
        invoiceObject.Invoice_Type__c = 'New License';
        
        insert invoiceObject;
        
        //Insert in the list...
        invoiceIdsList.add(invoiceObject.id);
        
        //For Invoice Line Item Object Records....
        List<Invoice_Line_Item__c> invoiceItemList = new List<Invoice_Line_Item__c>();  
        Invoice_Line_Item__c invoiceItemObject1 = new Invoice_Line_Item__c();
        invoiceItemObject1.Amount__c = 67;
        invoiceItemObject1.Invoice__c = invoiceObject.id;
        invoiceItemObject1.Start_Date__c = System.Today();
        invoiceItemObject1.End_Date__c = System.today().addYears(1);
        //insert invoiceItemObject1;
        invoiceItemList.add(invoiceItemObject1);
        
        Invoice_Line_Item__c invoiceItemObject2 = new Invoice_Line_Item__c();
        invoiceItemObject2.Amount__c = 67;
        invoiceItemObject2.Invoice__c = invoiceObject.id;
        invoiceItemObject2.Start_Date__c = System.Today().addYears(1);
        invoiceItemObject2.End_Date__c = System.today().addYears(2);
        invoiceItemObject2.Suspension__c = fineObject1.id;
        //insert invoiceItemObject2;
        invoiceItemList.add(invoiceItemObject2);
        
        //For INserting hte Records of Invoice Line Items...
        if(invoiceItemList.size() > 0)
        	insert invoiceItemList;
        
    	//Calling the Methods...
    	//result = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceObject.Id,amendmentObject1.Id);
    	resultList = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceIdsList,amendmentObject1.Id);
    	        
        
    }
    
    static testMethod void myUnitTest2() 
    {
    	/**************** FOR AMENDMENT METHODS In THIS CLASS TEST COVERAGE ********/
        // TO DO: implement unit test
        string result = null;
        PageReference pageRef = null;
        List<String> resultList = null;
        
        RecordType recordType = [select Id,IsActive,SObjectType,DeveloperName from RecordType where DeveloperName = 'New_Tenancy_Contract' AND SObjectType = 'Tenancy_Contract__c'];
        Map<string,RecordType> amendmentRecordTypeMap = new Map<string,RecordType>();
        for(RecordType tempObject : [SELECT Id,SObjectType,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' AND IsActive =: true])
        {
        	amendmentRecordTypeMap.put(tempObject.DeveloperName, tempObject);
        	
        }
        
        
        //For Tenancy Contract for Amendement Method...
        //Account Object Record...
        Account accountObject2 = new Account();
        accountObject2.Name = 'Test Account';
        accountObject2.License_Application_Step__c = 'Renewal Started';
        //accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        accountObject2.License_Application_Type__c = 'Renewal';
        accountObject2.Activity__c = 'Trading - One Activity';
        accountObject2.License_Issue_Date__c = system.today();
        accountObject2.License_Expiry_Date__c = System.Today().addYears(1);
        insert accountObject2;
        
        Location__c locationObject4 = new Location__c();
        locationObject4.Name = 'Test Land3 ';
        locationObject4.Location_Type__c = 'Land';
        locationObject4.Rental_Rate__c = 18000;
        insert locationObject4;
        Location__c locationObject5 = new Location__c();
        locationObject5.Name = 'Test Land33 ';
        locationObject5.Location_Type__c = 'Land';
        locationObject5.Rental_Rate__c = 18000;
        insert locationObject5;
        
        Location__c locationObject6 = new Location__c();
        locationObject6.Name = 'Test Land31 ';
        locationObject6.Location_Type__c = 'Land';
        locationObject6.Rental_Rate__c = 18000;
        insert locationObject6;
        
        Tenancy_Contract__c tenancyObject3 = new Tenancy_Contract__c();
        tenancyObject3.Location__c = locationObject4.id;
        tenancyObject3.RecordTypeId = recordType.id;
        tenancyObject3.Tenant__c = accountObject2.id;
        tenancyObject3.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject3.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject3;
        
        Tenancy_Contract__c tenancyObject4 = new Tenancy_Contract__c();
        tenancyObject4.Location__c = locationObject4.id;
        tenancyObject4.RecordTypeId = recordType.id;
        tenancyObject4.Tenant__c = accountObject2.id;
        tenancyObject4.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject4.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject4;
        
        Tenancy_Contract__c tenancyObject5 = new Tenancy_Contract__c();
        tenancyObject5.Location__c = locationObject4.id;
        tenancyObject5.RecordTypeId = recordType.id;
        tenancyObject5.Tenant__c = accountObject2.id;
        tenancyObject5.Tenancy_Contract_Start_Date__c = accountObject2.License_Issue_Date__c;
        tenancyObject5.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject5;
        
        //For Update the Location with the current Locaiton...
        locationObject4.Current_Tenancy_Contract__c = tenancyObject3.Id;
        update locationObject4;
        
        locationObject5.Current_Tenancy_Contract__c = tenancyObject4.Id;
        update locationObject5;
        
        locationObject6.Current_Tenancy_Contract__c = tenancyObject5.Id;
        update locationObject6;
        
        
        
        //For Suspension Object Records...
        Fines__c fineObject1 = new Fines__c();
        fineObject1.Issue_Date__c = System.today();
        fineObject1.Account__c = accountObject2.id;
        fineObject1.Fine_Type__c = 'Fix Amount';
        fineObject1.Fine_Amount__c = 1000;
        fineObject1.Fines_Included__c = true;
        fineObject1.Status__c = 'Approved';
        insert fineObject1;
        
        
        //For Fees Object Records....
        List<Fee__c> feeObjectList = new List<Fee__c>();
        
        Fee__c feeObject3 = new Fee__c();
        feeObject3.Name = 'Amendment - Add Location';
        feeObject3.Fee_Type__c = 'Amendment - Add Location';
        feeObject3.Price__c = 56;
        //insert feeObject3;
        feeObjectList.add(feeObject3);
        
        Fee__c feeObject4 = new Fee__c();
        feeObject4.Name = 'Amendment – Change License Type Fee';
        feeObject4.Fee_Type__c = 'Amendment – Change License Type Fee';
        feeObject4.Price__c = 56;
        //insert feeObject4;
        feeObjectList.add(feeObject4);
                
        Fee__c feeObject5 = new Fee__c();
        feeObject5.Name = 'Activity1Activty2 Fee';
        feeObject5.Fee_Type__c = 'Activity1Activty2 Fee';
        feeObject5.Price__c = 56;
        //insert feeObject5;
        feeObjectList.add(feeObject5);
        
        Fee__c feeObject6 = new Fee__c();
        feeObject6.Name = 'Activity1Activty3 Fee';
        feeObject6.Fee_Type__c = 'Activity1Activty3 Fee';
        feeObject6.Price__c = 56;
        //insert feeObject6;
        feeObjectList.add(feeObject6);
        
        
        Fee__c feeObject7 = new Fee__c();
        feeObject7.Name = 'Activity1General Fee';
        feeObject7.Fee_Type__c = 'Activity1General Fee';
        feeObject7.Price__c = 56;
        //insert feeObject7;
        feeObjectList.add(feeObject7);
        
        Fee__c feeObject8 = new Fee__c();
        feeObject8.Name = 'Activity1Services Fee';
        feeObject8.Fee_Type__c = 'Activity1Services Fee';
        feeObject8.Price__c = 56;
        //insert feeObject8;
        feeObjectList.add(feeObject8);
        
        Fee__c feeObject9 = new Fee__c();
        feeObject9.Name = 'Activity1Industrial Fee';
        feeObject9.Fee_Type__c = 'Activity1Industrial Fee';
        feeObject9.Price__c = 56;
        //insert feeObject9;
        feeObjectList.add(feeObject9);
        
        Fee__c feeObject10 = new Fee__c();
        feeObject10.Name = 'Activity2Activity3 Fee';
        feeObject10.Fee_Type__c = 'Activity2Activity3 Fee';
        feeObject10.Price__c = 56;
        //insert feeObject10;
        feeObjectList.add(feeObject10);
        
        Fee__c feeObject11 = new Fee__c();
        feeObject11.Name = 'Activity2General Fee';
        feeObject11.Fee_Type__c = 'Activity2General Fee';
        feeObject11.Price__c = 56;
        //insert feeObject11;
        feeObjectList.add(feeObject11);
        
        Fee__c feeObject12 = new Fee__c();
        feeObject12.Name = 'Activity2Services Fee';
        feeObject12.Fee_Type__c = 'Activity2Services Fee';
        feeObject12.Price__c = 56;
        //insert feeObject12;
        feeObjectList.add(feeObject12);
        
        Fee__c feeObject13 = new Fee__c();
        feeObject13.Name = 'Activity2Industrial Fee';
        feeObject13.Fee_Type__c = 'Activity2Industrial Fee';
        feeObject13.Price__c = 56;
        //insert feeObject13;
        feeObjectList.add(feeObject13);
        
        Fee__c feeObject14 = new Fee__c();
        feeObject14.Name = 'Activity3General Fee';
        feeObject14.Fee_Type__c = 'Activity3General Fee';
        feeObject14.Price__c = 56;
        //insert feeObject14;
        feeObjectList.add(feeObject14);
        
        Fee__c feeObject15 = new Fee__c();
        feeObject15.Name = 'Activity3Services Fee';
        feeObject15.Fee_Type__c = 'Activity3Services Fee';
        feeObject15.Price__c = 56;
        //insert feeObject15;
        feeObjectList.add(feeObject15);
        
        Fee__c feeObject16 = new Fee__c();
        feeObject16.Name = 'Activity3Industrial Feee';
        feeObject16.Fee_Type__c = 'Activity3Industrial Fee';
        feeObject16.Price__c = 56;
        //insert feeObject16;
        feeObjectList.add(feeObject16);
        
        Fee__c feeObject17 = new Fee__c();
        feeObject17.Name = 'Amendment - Add Partner Fee';
        feeObject17.Fee_Type__c = 'Amendment - Add Partner Fee';
        feeObject17.Price__c = 56;
        //insert feeObject17;
        feeObjectList.add(feeObject17);
        
        Fee__c feeObject18 = new Fee__c();
        feeObject18.Name = 'Amendment - Change Share Percentage Fee';
        feeObject18.Fee_Type__c = 'Amendment - Change Share Percentage Fee';
        feeObject18.Price__c = 56;
        //insert feeObject18;
        feeObjectList.add(feeObject18);
        
        Fee__c feeObject19 = new Fee__c();
        feeObject19.Name = 'Amendment - Remove Partner Fee';
        feeObject19.Fee_Type__c = 'Amendment - Remove Partner Fee';
        feeObject19.Price__c = 56;
        //insert feeObject19;
        feeObjectList.add(feeObject19);
        
        Fee__c feeObject20 = new Fee__c();
        feeObject20.Name = 'Amendment – Replace Partner Fee';
        feeObject20.Fee_Type__c = 'Amendment – Replace Partner Fee';
        feeObject20.Price__c = 56;
        //insert feeObject20;
        feeObjectList.add(feeObject20);
        
        Fee__c feeObject21 = new Fee__c();
        feeObject21.Name = 'Amendment - New Article of Association Price';
        feeObject21.Fee_Type__c = 'Amendment - New Article of Association Price';
        feeObject21.Price__c = 56;
        //insert feeObject21;
        feeObjectList.add(feeObject21);
        
        Fee__c feeObject22 = new Fee__c();
        feeObject22.Name = 'Amendment – Change Company Manager';
        feeObject22.Fee_Type__c = 'Amendment – Change Company Manager';
        feeObject22.Price__c = 56;
        //insert feeObject22;
        feeObjectList.add(feeObject22);
        
        Fee__c feeObject23 = new Fee__c();
        feeObject23.Name = 'Amendment - Change Location';
        feeObject23.Fee_Type__c = 'Amendment - Change Location';
        feeObject23.Price__c = 56;
        //insert feeObject23;
        feeObjectList.add(feeObject23);
        
        Fee__c feeObject24 = new Fee__c();
        feeObject24.Name = 'Amendment - Change Company Name';
        feeObject24.Fee_Type__c = 'Amendment - Change Company Name';
        feeObject24.Price__c = 56;
        //insert feeObject24;
        feeObjectList.add(feeObject24);
        
        
        Fee__c feeObject25 = new Fee__c();
        feeObject25.Name = 'Advertisement Fee';
        feeObject25.Fee_Type__c = 'Advertisement Fee';
        feeObject25.Price__c = 56;
        //insert feeObject25;
        feeObjectList.add(feeObject25);
        
        Fee__c feeObject26 = new Fee__c();
        feeObject26.Name = 'Establishment Card Fee';
        feeObject26.Fee_Type__c = 'Establishment Card Fee';
        feeObject26.Price__c = 56;
        //insert feeObject26;
        feeObjectList.add(feeObject26);
        
        Fee__c feeObject27 = new Fee__c();
        feeObject27.Name = 'Employment ID Card Fee';
        feeObject27.Fee_Type__c = 'Employment ID Card Fee';
        feeObject27.Price__c = 56;
        //insert feeObject27;
        feeObjectList.add(feeObject27);
        
        Fee__c feeObject28 = new Fee__c();
        feeObject28.Name = 'Free Zone Entity Fee';
        feeObject28.Fee_Type__c = 'Free Zone Entity Fee';
        feeObject28.Price__c = 56;
        //insert feeObject28;
        feeObjectList.add(feeObject28);
        
        Fee__c feeObject29 = new Fee__c();
        feeObject29.Name = 'Amendment - Change Activity';
        feeObject29.Fee_Type__c = 'Amendment - Change Activity';
        feeObject29.Price__c = 56;
        //insert feeObject29;
        feeObjectList.add(feeObject29);
        
        Fee__c feeObject30 = new Fee__c();
        feeObject30.Name = 'Amendment - Remove Location';
        feeObject30.Fee_Type__c = 'Amendment - Remove Location';
        feeObject30.Price__c = 56;
        //insert feeObject30;
        feeObjectList.add(feeObject30);
        
        Fee__c feeObject31 = new Fee__c();
        feeObject31.Name = 'Amendment - New Key';
        feeObject31.Fee_Type__c = 'Amendment - New Key';
        feeObject31.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject31);
        
        Fee__c feeObject32 = new Fee__c();
        feeObject32.Name = 'Amendment - Change Company Manager';
        feeObject32.Fee_Type__c = 'Amendment - Change Company Manager';
        feeObject32.Price__c = 56;
        //insert feeObject31;
        feeObjectList.add(feeObject32);
        
        //Now Insert the Fee Object List...
        if(feeObjectList.size() > 0)
        	insert feeObjectList;
        
        
        //For Service Pricebook...
        List<Service_Price_Book__c> serviceBookList = new List<Service_Price_Book__c>();
        List<string> serviceBookTypeList = new List<string>();
        
        serviceBookTypeList.add('Renewal');
        serviceBookTypeList.add('New License');
        serviceBookTypeList.add('Cancellation');
        serviceBookTypeList.add('Amendment');
        serviceBookTypeList.add('Renewal Additional');
        
        for(String tempString : serviceBookTypeList)
        {
        	for(integer counter = 0; counter < feeObjectList.size(); counter++ )
        	{
        		Service_Price_Book__c servicePriceBook1 = new  Service_Price_Book__c();
	            servicePriceBook1.fee__c = feeObjectList[counter].id;
	            servicePriceBook1.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook1.License_App_Category__c  = 'Trading - One Activity';
	            servicePriceBook1.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook2 = new  Service_Price_Book__c();
	            servicePriceBook2.fee__c = feeObjectList[counter].id;
	            servicePriceBook2.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook2.License_App_Category__c  = 'Trading - Two Activity';
	            servicePriceBook2.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook3 = new  Service_Price_Book__c();
	            servicePriceBook3.fee__c = feeObjectList[counter].id;
	            servicePriceBook3.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook3.License_App_Category__c  = 'Trading - Three Activity';
	            servicePriceBook3.isActive__c = true;
	            
        		Service_Price_Book__c servicePriceBook4 = new  Service_Price_Book__c();
	            servicePriceBook4.fee__c = feeObjectList[counter].id;
	            servicePriceBook4.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook4.Location_Type__c = 'Land';
	            servicePriceBook4.License_App_Category__c  = 'Location'; 
	            servicePriceBook4.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook5 = new  Service_Price_Book__c();
	            servicePriceBook5.fee__c = feeObjectList[counter].id;
	            servicePriceBook5.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook5.Location_Type__c = 'Office';
	            servicePriceBook5.License_App_Category__c  = 'Location'; 
        		servicePriceBook5.isActive__c = true;
        		
        		Service_Price_Book__c servicePriceBook6 = new  Service_Price_Book__c();
	            servicePriceBook6.fee__c = feeObjectList[counter].id;
	            servicePriceBook6.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook6.Location_Type__c = 'Guarantee';
	            servicePriceBook6.License_App_Category__c  = 'Location';
	            servicePriceBook6.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook7 = new  Service_Price_Book__c();
	            servicePriceBook7.fee__c = feeObjectList[counter].id;
	            servicePriceBook7.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook7.License_App_Category__c  = 'Trading - General Trading';
	            servicePriceBook7.isActive__c = true;
	            
	            Service_Price_Book__c servicePriceBook8 = new  Service_Price_Book__c();
	            servicePriceBook8.fee__c = feeObjectList[counter].id;
	            servicePriceBook8.License_Application_Type__c  = tempString;//'New License';
	            servicePriceBook8.License_App_Category__c  = 'Services';
	            servicePriceBook8.isActive__c = true;
        		
        		//Adding in the list...
        		serviceBookList.add(servicePriceBook1);
        		serviceBookList.add(servicePriceBook2);
        		serviceBookList.add(servicePriceBook3);
        		serviceBookList.add(servicePriceBook4);
        		serviceBookList.add(servicePriceBook5);
        		serviceBookList.add(servicePriceBook6);
        		serviceBookList.add(servicePriceBook7);
        		serviceBookList.add(servicePriceBook8);
        		
        		
        		
        	}
        
        
        }
        
        //For inserting the Service PRicebook...
        if(serviceBookList.size() > 0)
        	insert serviceBookList;
        
        
         //For Amendment Object For New Tenancy Contract Method...
        Amendment__c amendmentObject1 = new Amendment__c();
        amendmentObject1.RecordTypeId = amendmentRecordTypeMap.get('Company_Amendment_Change_Company_Name').Id;
        amendmentObject1.Account__c = accountObject2.Id;
        amendmentObject1.New_Location__c = locationObject4.Id;
        amendmentObject1.New_Location_2__c = locationObject5.Id;
        amendmentObject1.New_Location_3__c = locationObject6.Id;
        amendmentObject1.New_License_Type__c = 'Trading - Two Activity';
        //amendmentObject.Chamber_History__c = chamberObject.id;
        insert amendmentObject1;
        
        
        //Now Calling the Methods...
        string popDate1  = string.valueof(accountObject2.License_Expiry_Date__c); 
        popDate1 = string.valueOf(popDate1.split('-')[2]+'/'+popDate1.split('-')[1]+'/'+popDate1.split('-')[0]);
        
        /*amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Two Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - Three Activity';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    
    	//Update Account Activity....
    	accountObject2.Activity__c = 'Trading - Three Activity';
    	update accountObject2;
    	
    	amendmentObject1.New_License_Type__c = 'Trading - General Trading';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);*/
        
        amendmentObject1.New_License_Type__c = 'Services';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
        
        amendmentObject1.New_License_Type__c = 'Industrial';
        update amendmentObject1;
        resultList = issueRecieptAndInvoiceClass.generatingAmendmentInvoiceAndLineItemForAmendmentMethod(accountObject2.id,amendmentObject1.Id,'Company Amendment - Change License Type',null,'False',null);
    	
    	
    	//For Receipt Amendment Methods...
    	List<Id> invoiceIdsList = new List<Id>();
    	
    	 //For Invoice Object Records...
        Invoice__c invoiceObject = new Invoice__c();
        invoiceObject.Account__c = accountObject2.id;
        invoiceObject.Date__c = System.Today();
        invoiceObject.Fee_Application_Type__c = 'New License';
        invoiceObject.Invoice_Type__c = 'New License';
        
        insert invoiceObject;
        
        //Insert in the list...
        invoiceIdsList.add(invoiceObject.id);
        
        //For Invoice Line Item Object Records....
        List<Invoice_Line_Item__c> invoiceItemList = new List<Invoice_Line_Item__c>();  
        Invoice_Line_Item__c invoiceItemObject1 = new Invoice_Line_Item__c();
        invoiceItemObject1.Amount__c = 67;
        invoiceItemObject1.Invoice__c = invoiceObject.id;
        invoiceItemObject1.Start_Date__c = System.Today();
        invoiceItemObject1.End_Date__c = System.today().addYears(1);
        //insert invoiceItemObject1;
        invoiceItemList.add(invoiceItemObject1);
        
        Invoice_Line_Item__c invoiceItemObject2 = new Invoice_Line_Item__c();
        invoiceItemObject2.Amount__c = 67;
        invoiceItemObject2.Invoice__c = invoiceObject.id;
        invoiceItemObject2.Start_Date__c = System.Today().addYears(1);
        invoiceItemObject2.End_Date__c = System.today().addYears(2);
        invoiceItemObject2.Suspension__c = fineObject1.id;
        //insert invoiceItemObject2;
        invoiceItemList.add(invoiceItemObject2);
        
        //For INserting hte Records of Invoice Line Items...
        if(invoiceItemList.size() > 0)
        	insert invoiceItemList;
        
    	//Calling the Methods...
    	//result = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceObject.Id,amendmentObject1.Id);
    	resultList = issueRecieptAndInvoiceClass.generatingReceiptForAmendmentMethod(accountObject2.id,invoiceIdsList,amendmentObject1.Id);
    	        
        
    }
    
    
}